From a427f1e82e1db8c56c1d198ffbd89a2953e08534 Mon Sep 17 00:00:00 2001 From: Carlos Soriano Date: Thu, 27 Aug 2015 20:58:27 +0200 Subject: [PATCH] gtkplacesview: only filter out placeholder if searching We were filtering out placeholders if the list box filters while not searching, which is not what we want, since placeholders should only be hidden if the view is searching. https://bugzilla.gnome.org/show_bug.cgi?id=754150 --- gtk/gtkplacesview.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c index 2792973221..9289d16777 100644 --- a/gtk/gtkplacesview.c +++ b/gtk/gtkplacesview.c @@ -1888,11 +1888,13 @@ listbox_filter_func (GtkListBoxRow *row, gboolean is_network; gboolean is_placeholder; gboolean retval; + gboolean searching; gchar *name; gchar *path; priv = gtk_places_view_get_instance_private (GTK_PLACES_VIEW (user_data)); retval = FALSE; + searching = priv->search_query && priv->search_query[0] != '\0'; is_network = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (row), "is-network")); is_placeholder = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (row), "is-placeholder")); @@ -1900,10 +1902,10 @@ listbox_filter_func (GtkListBoxRow *row, if (is_network && priv->local_only) return FALSE; - if (is_placeholder) + if (is_placeholder && searching) return FALSE; - if (!priv->search_query || priv->search_query[0] == '\0') + if (!searching) return TRUE; g_object_get (row, -- 2.30.2